<?php
    require_once $_site->get_handlepath('device');

	$id = request('id');
	$info=device_fun_get_record($id);

	$truckType=array('a'=>'A 型','b'=>'B 型','c'=>'C 型');
	$dustType=array('1'=>'Ⅰ类','2'=>'Ⅱ类','3'=>'Ⅲ 类');
	$onloadType=array(1=>"空车",2=>"重车");
	require_once("header.php");

	require_once $_site->get_handlepath('admin');
	$xinfo=admin_fun_find_admin($info['xid']);

	/**
	require_once $_site->get_handlepath('device');
	$bind = project_fun_bind($info['pid'], $info['did']);
	**/
?>

	<script type="text/javascript" charset="utf-8">
		loader.file({
			plugin:['validform/main','dialog/main','my97/wdatepicker'],
			skincss:['list']
		})

		function agree(){
			$.post("/handle.php",$("#form1").serialize(),function(res){
				if(res.state){
					parent.change(res.info);
					return;
				}
				alert(res.msg);
				},'json');
		}
	</script>
	<style type="text/css">
		.table td a.hover{display: line-block;background: #60D277;color: #ffffff;padding:5px;}
	</style>
</head>
<body>
	<div class="main">
      <form action="/handle.php" method="post" id="form1">
      <input type="hidden" name="h" value="device/edit">
      <input type="hidden" name="id" value="<?php echo $id?>">

        <table cellpadding="0" cellspacing="1" border="0" class="table">
          <tr>
		     <td valign="top" style="height:200px;width:45%;padding:2px;">
			   <img src="<?php $img=1==$info['delimg']?'/static/images/imgdel.jpg':$info['img'];echo $img ;?>" width="100%">
			 </td>
			 <td>

		<table cellpadding="0" cellspacing="1" border="0" class="table" style="width:98%;">

			<tr>
			    <td>设备号</td>
				<td style="text-align: left">
					<strong><?php echo $info['dno']?></strong>
				</td>
			    <td>登记时间</td>
				<td style="text-align: left">
					<?php echo date('Y-m-d H:i:s',$info['ctime'])?>
				</td>
			</tr>

			<tr>
			    <td>负责人</td>
				<td style="text-align: left">
				<?php echo $xinfo['name']?>
			     </td>
			    <td>车牌号</td>
				<td style="text-align: left">
				    <?php echo $info['dname']?>
			    </td>
			</tr>

			<tr>
			    <td>产权人</td>
				<td style="text-align: left">
				    <?php echo $info['downer']?>
				</td>
			    <td>车型</td>
				<td style="text-align: left">
				    <?php echo $info['car_type']?>
				</td>
			</tr>

			<tr>
			    <td>机车手</td>
				<td style="text-align: left">
					<?php echo $info['doper']?>
				</td>
			    <td>车手电话</td>
				<td style="text-align: left">
				    <?php echo $info['dophone']?>
				</td>
			</tr>

			<tr>
			    <td>车手编号</td>
				<td style="text-align: left">
					<?php echo $info['jsno']?>
				</td>
			    <td>地块编号</td>
				<td style="text-align: left">
				    <?php echo $info['dkno']?>
				</td>
			</tr>

            <?php if(0==$info['gcat']){ ?>
			<tr>
			    <td>渣车</td>
				<td style="text-align: left">
					<select name="truck">
					  <?php
                        foreach($truckType as $key=>$val){
                        ?>
                        <option value="<?php echo $key?>" <?php if($key==$info['truck']){echo "selected";} ?>><?php echo $val;?></option>
                        <?php
                        }
					  ?>
					</select>
				</td>
			    <td>土石</td>
				<td style="text-align: left">
					<select name="dust">
					  <?php
                        foreach($dustType as $key=>$val){
                        ?>
                        <option value="<?php echo $key?>"  <?php if($key==$info['dust']){echo "selected";} ?>><?php echo $val;?></option>
                        <?php
                        }
					  ?>
					</select>
				</td>
			</tr>

			<tr>
			    <td>装载情况</td>
				<td style="text-align: left">
					<select name="onload">
					  <?php
                        foreach($onloadType as $key=>$val){
                        ?>
                        <option value="<?php echo $key?>"  <?php if($key==$info['onload']){echo "selected";} ?>><?php echo $val;?></option>
                        <?php
                        }
					  ?>
					</select>
				</td>
                <td>记录时间</td>
                <td style="text-align: left">
                    <?php echo date('Y-m-d H:i:s',$info['time'])?>
                </td>
            </tr>
            <?php }else{ ?>
                <tr>
                    <td>记录类型</td>
                    <td>不饱和登记</td>
                    <td>记录时间</td>
                    <td style="text-align: left">
                        <?php echo date('Y-m-d H:i:s',$info['time'])?>
                    </td>
                </tr>
            <?php } ?>

			<?php if($cookie['group']!=12){?>
			<tr>
				<td colspan="4" >
                      <input type="button" value="修  改" class="button1" onclick="agree()">&nbsp;&nbsp;
				</td>
			</tr>
			<?php }?>
		</table>

			 </td>
		  </tr>
		</table>
	</form>
	</div>
</body>
</html>
